﻿<%@ Page Title="Coastal Climbing - Admin - Gallery" Language="C#" MasterPageFile="~/Auth/Auth.Master"
    AutoEventWireup="true" CodeBehind="Gallery.aspx.cs" Inherits="CoastalClimbing.Auth.Gallery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function Show() {
            document.getElementById('divAdd').style.visibility = "visible";
            document.getElementById('<%=txtTitle.ClientID %>').focus();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <span class="thirtyWhite">Gallery</span>
    <br />
    <asp:Label ID="lblMessage" runat="server" ForeColor="red" />
    <br />
    <asp:GridView ID="grvGallery" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True"
        DataKeyNames="ID" OnRowEditing="EditRecord" OnRowUpdating="UpdateRecord" OnRowCancelingEdit="CancelRecord"
        GridLines="Both" CellPadding="4" ForeColor="#333333">
        <Columns>
            <asp:TemplateField HeaderText="ID" Visible="false">
                <ItemTemplate>
                    <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Title">
                <ItemTemplate>
                    <asp:Label ID="lblTitle" runat="server" Text='<%# Eval("Title") %>' />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtTitle" runat="server" Text='<%# Eval("Title") %>' />
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" ForeColor="Black" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ID", "~/Auth/GalleryImages.aspx?GalleryID={0}") %>' Text="Edit Images" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#E3EAEB" />
        <EditRowStyle BackColor="#7C6F57" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#ffd80b" Font-Bold="True" ForeColor="333333" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <br />
    <asp:HyperLink ID="hyperAdd" runat="server" NavigateUrl='javascript:Show();' Text="Add Gallery"
        ForeColor="White" />
    <br />
    <div id="divAdd" style="visibility: hidden;">
        <asp:Table ID="tblAdd" runat="server">
            <asp:TableHeaderRow>
                <asp:TableHeaderCell>
                        Title
                </asp:TableHeaderCell>
            </asp:TableHeaderRow>
            <asp:TableRow>
                <asp:TableCell>
                    <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
                </asp:TableCell>
                <asp:TableCell>
                    <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" />
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
</asp:Content>
